//
//  KHViewController.m
//  KHDBTools
//
//  Created by apang on 02/02/2018.
//  Copyright (c) 2018 apang. All rights reserved.
//

#import "KHViewController.h"
#import "KHModel.h"
#import <KHDBTools/KHDBTools.h>
#import <YYModel/YYModel.h>
#import "KHNodeModel.h"
@interface KHViewController ()

@end

@implementation KHViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
//    [KHModel updateTable:nil];
//    KHModel * model = [[KHModel alloc] init];
//    model.array = @[@"ssss",@"asdasfd",@"efgre"];
//    [model save];
//    NSArray * array = [KHModel inquiryAll:nil];
//    for (KHModel *model in array) {
//        NSLog(@"%@",model.array);
//    }
    NSString * filePath = [[NSBundle mainBundle] pathForResource:@"2244420180316065518700" ofType:@"json"];
    // 将文件数据化
    NSData *data = [[NSData alloc] initWithContentsOfFile:filePath];
    // 对数据进行JSON格式化并返回字典形式
    NSMutableArray * tmpArr = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
    
    NSArray * model = [NSArray yy_modelArrayWithClass:[KHNodeModel class] json:tmpArr];
//    [KHNodeModel saveObjects:model];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
